check if multiple variables are null c#

77

check if multiple variables are null c# -

if((string1 ?? string2 ?? string3 ?? string4 ?? string5 ?? string6) == null){ ;}

c# check multiple variables for null -

bool allNull = strings.All(s => s == null);
// if you are using a collection

Comments

Submit
0 Comments